#include<reg52.h>
#include<stdio.h>
#include<string.h>
#include<intrins.h>

void send_msg(char * msg){
	while(*msg != '\0'){
		SBUF=*msg++;
		while(TI==0);
		TI=0;
	}
}
static char msg[16];
void main(void){
	int count=0;
	SCON=0x50;
	TMOD |= 0x20;
	TH1 = 221;
	TR1=1;
	
	TMOD |= 0x1;
	TL0 =0x10;
	TH0= 0x10;
	TR0=1;
	
	while(1){
		while(!TF0){}
		TF0=0;
		TL0=0x10;
		TH0=0x10;
		sprintf(msg,"Hello %d\n",count++);
		send_msg(msg);
	}
}